package org.example.reemploymentsys.controller;

import lombok.RequiredArgsConstructor;
import org.example.reemploymentsys.tool.OssOpe;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequiredArgsConstructor
public class OssController {
    @Autowired
    private OssOpe ossService;
    //上传头像的方法
    @PostMapping("/uploadAvatar")
    public String uploadOssFile(MultipartFile file){
        //返回上传到oss的路径
        return ossService.uploadFileAvatar(file);
    }
    /**
     * 上传公有资料
     * @param file
     * @return
     */
    @PostMapping("/uploadDocument")
    public String uploadOssFileDocument(MultipartFile file){
        return ossService.uploadFilePublicDocu(file);
        //返回上传到oss的路径
    }

}
